<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>QCNSim: QcnSim/ProtocolDataUnit.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">QCNSim
   </div>
   <div id="projectbrief">Simulator for Quake-Catcher Network</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d21be12960473ba5c51e5f9beea3525e.html">QcnSim</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">ProtocolDataUnit.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_protocol_data_unit_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_protocol_data_unit_8h.html">ProtocolDataUnit.h</a>&quot;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="class_protocol_data_unit.html#a2103a889317ce5ea0fdce010c1c3bddd">   35</a></span>&#160;<a class="code" href="class_protocol_data_unit.html#a2103a889317ce5ea0fdce010c1c3bddd">ProtocolDataUnit::ProtocolDataUnit</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">int</span> priority, std::shared_ptr&lt;Entity&gt; associatedEntity, std::shared_ptr&lt;Entity&gt; source, std::shared_ptr&lt;Entity&gt; destination, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pduSize): </div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;        <a class="code" href="class_token.html">Token</a>(id, priority, associatedEntity, source, destination), pduSize(pduSize), ttl(<a class="code" href="_protocol_data_unit_8h.html#aa9b73542f958f4edfe5ebea8efe0ff8b">DEFAULT_TTL</a>) {</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;}</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="class_protocol_data_unit.html#a6fd7c127fa6524797669da51a3929899">   54</a></span>&#160;<a class="code" href="class_protocol_data_unit.html#a2103a889317ce5ea0fdce010c1c3bddd">ProtocolDataUnit::ProtocolDataUnit</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <span class="keywordtype">id</span>, <span class="keywordtype">int</span> priority, std::shared_ptr&lt;Entity&gt; associatedEntity, std::shared_ptr&lt;Entity&gt; source, std::shared_ptr&lt;Entity&gt; destination, std::shared_ptr&lt;Entity&gt; previous, std::shared_ptr&lt;Entity&gt; next, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pduSize): </div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;        <a class="code" href="class_token.html">Token</a>(id, priority, associatedEntity, source, destination, previous, next), pduSize(pduSize), ttl(<a class="code" href="_protocol_data_unit_8h.html#aa9b73542f958f4edfe5ebea8efe0ff8b">DEFAULT_TTL</a>) {</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;}</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="class_protocol_data_unit.html#a90ac3f7a0d9bdde1bcb05f13e0abaf4c">   71</a></span>&#160;<a class="code" href="class_protocol_data_unit.html#a2103a889317ce5ea0fdce010c1c3bddd">ProtocolDataUnit::ProtocolDataUnit</a>(<a class="code" href="class_simulator_globals.html">SimulatorGlobals</a> &amp;simulatorGlobals, <span class="keywordtype">int</span> priority, std::shared_ptr&lt;Entity&gt; associatedEntity, std::shared_ptr&lt;Entity&gt; source, std::shared_ptr&lt;Entity&gt; destination, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pduSize): </div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;        <a class="code" href="class_token.html">Token</a>(simulatorGlobals, priority, associatedEntity, source, destination), pduSize(pduSize), ttl(<a class="code" href="_protocol_data_unit_8h.html#aa9b73542f958f4edfe5ebea8efe0ff8b">DEFAULT_TTL</a>) {</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;}</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div>
<div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="class_protocol_data_unit.html#a61ccb4e690601f8906ad0f5cb995bc97">   90</a></span>&#160;<a class="code" href="class_protocol_data_unit.html#a2103a889317ce5ea0fdce010c1c3bddd">ProtocolDataUnit::ProtocolDataUnit</a>(<a class="code" href="class_simulator_globals.html">SimulatorGlobals</a> &amp;simulatorGlobals, <span class="keywordtype">int</span> priority, std::shared_ptr&lt;Entity&gt; associatedEntity, std::shared_ptr&lt;Entity&gt; source,</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        std::shared_ptr&lt;Entity&gt; destination, std::shared_ptr&lt;Entity&gt; previous, std::shared_ptr&lt;Entity&gt; next, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pduSize): </div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        <a class="code" href="class_token.html">Token</a>(simulatorGlobals, priority, associatedEntity, source, destination, previous, next), pduSize(pduSize), ttl(<a class="code" href="_protocol_data_unit_8h.html#aa9b73542f958f4edfe5ebea8efe0ff8b">DEFAULT_TTL</a>) {</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;}</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div>
<div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="class_protocol_data_unit.html#af23de900b9dd30746f5badb43a9171a6">  109</a></span>&#160;<a class="code" href="class_protocol_data_unit.html#a2103a889317ce5ea0fdce010c1c3bddd">ProtocolDataUnit::ProtocolDataUnit</a>(<a class="code" href="class_simulator_globals.html">SimulatorGlobals</a> &amp;simulatorGlobals, <span class="keywordtype">int</span> priority, std::shared_ptr&lt;Entity&gt; associatedEntity, std::shared_ptr&lt;Entity&gt; source,</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;        std::shared_ptr&lt;Entity&gt; destination, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pduSize, std::vector&lt;std::shared_ptr&lt;Entity&gt;&gt; explicitRoute): </div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;        <a class="code" href="class_token.html">Token</a>(simulatorGlobals, priority, associatedEntity, source, destination, explicitRoute), pduSize(pduSize), ttl(<a class="code" href="_protocol_data_unit_8h.html#aa9b73542f958f4edfe5ebea8efe0ff8b">DEFAULT_TTL</a>) {</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;}</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div>
<div class="line"><a name="l00130"></a><span class="lineno"><a class="line" href="class_protocol_data_unit.html#add4991f76d69a178bdecdd95e48205c2">  130</a></span>&#160;<a class="code" href="class_protocol_data_unit.html#a2103a889317ce5ea0fdce010c1c3bddd">ProtocolDataUnit::ProtocolDataUnit</a>(<a class="code" href="class_simulator_globals.html">SimulatorGlobals</a> &amp;simulatorGlobals, <span class="keywordtype">int</span> priority, std::shared_ptr&lt;Entity&gt; associatedEntity, std::shared_ptr&lt;Entity&gt; source,</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;        std::shared_ptr&lt;Entity&gt; destination, std::shared_ptr&lt;Entity&gt; previous, std::shared_ptr&lt;Entity&gt; next, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pduSize, std::vector&lt;std::shared_ptr&lt;Entity&gt;&gt; explicitRoute): </div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;        <a class="code" href="class_token.html">Token</a>(simulatorGlobals, priority, associatedEntity, source, destination, previous, next, explicitRoute), pduSize(pduSize), ttl(<a class="code" href="_protocol_data_unit_8h.html#aa9b73542f958f4edfe5ebea8efe0ff8b">DEFAULT_TTL</a>) {</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;}</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;</div>
<div class="line"><a name="l00145"></a><span class="lineno"><a class="line" href="class_protocol_data_unit.html#a74b060730431ea9b3fd969a4611fc4de">  145</a></span>&#160;<a class="code" href="class_protocol_data_unit.html#a2103a889317ce5ea0fdce010c1c3bddd">ProtocolDataUnit::ProtocolDataUnit</a>(std::shared_ptr&lt;Token&gt; token, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pduSize): <a class="code" href="class_token.html">Token</a>(token-&gt;id, token-&gt;priority, token-&gt;associatedEntity,</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;                                                                                              token-&gt;source, token-&gt;destination) {</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    <a class="code" href="class_token.html#a1647ede32e4d927f836a0f58342d77b2">previous</a> = token-&gt;previous;</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;    <a class="code" href="class_token.html#afc3016125b848c7e88fc5dc8510762ef">next</a> = token-&gt;next;</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    this-&gt;pduSize = <a class="code" href="class_protocol_data_unit.html#a52885cda1629baaace8edf4a93428c96">pduSize</a>;</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    this-&gt;<a class="code" href="class_token.html#a1251a6a9395ed89aac82e88f4c110335">setExplicitRoute</a>(token-&gt;getExplicitRoute());</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;    <a class="code" href="class_protocol_data_unit.html#a77fa6a4183a5810c81788f32da6590d1">ttl</a> = <a class="code" href="_protocol_data_unit_8h.html#aa9b73542f958f4edfe5ebea8efe0ff8b">DEFAULT_TTL</a>;</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    <a class="code" href="class_token.html#ae1697de3383688ddbe8196cb392bf2ac">absoluteGenerationTime</a> = token-&gt;getAbsoluteGenerationTime();</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <a class="code" href="class_token.html#af5c30f0a60ca47f772e51d06bf8a54c3">recordThisRoute</a> = token-&gt;isRouteBeingRecorded();</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;}</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;</div>
<div class="line"><a name="l00167"></a><span class="lineno"><a class="line" href="class_protocol_data_unit.html#a9d4bd6fe13c8cbb6cec40bd60cbeaf67">  167</a></span>&#160;<a class="code" href="class_protocol_data_unit.html#a2103a889317ce5ea0fdce010c1c3bddd">ProtocolDataUnit::ProtocolDataUnit</a>(std::shared_ptr&lt;Token&gt; token, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pduSize, std::vector&lt;std::shared_ptr&lt;Entity&gt;&gt; explicitRoute): <a class="code" href="class_token.html">Token</a>(token-&gt;id,</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;                                                                                                                                                  token-&gt;priority,</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;                                                                                                                                                  token-&gt;associatedEntity,</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;                                                                                                                                                  token-&gt;source,</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;                                                                                                                                                  token-&gt;destination) {</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    <a class="code" href="class_token.html#a1647ede32e4d927f836a0f58342d77b2">previous</a> = token-&gt;previous;</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    <a class="code" href="class_token.html#afc3016125b848c7e88fc5dc8510762ef">next</a> = token-&gt;next;</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    this-&gt;pduSize = <a class="code" href="class_protocol_data_unit.html#a52885cda1629baaace8edf4a93428c96">pduSize</a>;</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    this-&gt;<a class="code" href="class_token.html#a1251a6a9395ed89aac82e88f4c110335">setExplicitRoute</a>(explicitRoute);</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    <a class="code" href="class_protocol_data_unit.html#a77fa6a4183a5810c81788f32da6590d1">ttl</a> = <a class="code" href="_protocol_data_unit_8h.html#aa9b73542f958f4edfe5ebea8efe0ff8b">DEFAULT_TTL</a>;</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    <a class="code" href="class_token.html#ae1697de3383688ddbe8196cb392bf2ac">absoluteGenerationTime</a> = token-&gt;getAbsoluteGenerationTime();</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    <a class="code" href="class_token.html#af5c30f0a60ca47f772e51d06bf8a54c3">recordThisRoute</a> = token-&gt;isRouteBeingRecorded();</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;}</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;</div>
<div class="line"><a name="l00187"></a><span class="lineno"><a class="line" href="class_protocol_data_unit.html#a01adc1a7830a1a40af4daff835226ef3">  187</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_protocol_data_unit.html#a01adc1a7830a1a40af4daff835226ef3">ProtocolDataUnit::decrementTtl</a>() {</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    --<a class="code" href="class_protocol_data_unit.html#a77fa6a4183a5810c81788f32da6590d1">ttl</a>;</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;}</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;        </div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;</div>
<div class="line"><a name="l00197"></a><span class="lineno"><a class="line" href="class_protocol_data_unit.html#aff0a0c4b5851115f75ddee903bef0419">  197</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <span class="keywordtype">int</span> <a class="code" href="class_protocol_data_unit.html#aff0a0c4b5851115f75ddee903bef0419">ProtocolDataUnit::getTtl</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_protocol_data_unit.html#a77fa6a4183a5810c81788f32da6590d1">ttl</a>;</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;}</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;</div>
<div class="line"><a name="l00211"></a><span class="lineno"><a class="line" href="class_protocol_data_unit.html#a42a8e571a64f65379e3dfc719960ce53">  211</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_protocol_data_unit.html#a42a8e571a64f65379e3dfc719960ce53">ProtocolDataUnit::setTtl</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <span class="keywordtype">int</span> ttl) {</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    this-&gt;ttl = <a class="code" href="class_protocol_data_unit.html#a77fa6a4183a5810c81788f32da6590d1">ttl</a>;</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;}       </div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;        </div>
<div class="line"><a name="l00220"></a><span class="lineno"><a class="line" href="class_protocol_data_unit.html#acef2f04f3183ecfe20126c6faed978ff">  220</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="class_protocol_data_unit.html#acef2f04f3183ecfe20126c6faed978ff">ProtocolDataUnit::setPduSize</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pduSize) {</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    this-&gt;pduSize = <a class="code" href="class_protocol_data_unit.html#a52885cda1629baaace8edf4a93428c96">pduSize</a>;</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;}       </div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;</div>
<div class="line"><a name="l00229"></a><span class="lineno"><a class="line" href="class_protocol_data_unit.html#abdaa8ab1e636b146205e4cd2aecd81f5">  229</a></span>&#160;<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_protocol_data_unit.html#abdaa8ab1e636b146205e4cd2aecd81f5">ProtocolDataUnit::getPduSize</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="class_protocol_data_unit.html#a52885cda1629baaace8edf4a93428c96">pduSize</a>;</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;}</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;<span class="comment">// * Operator == (comparison) overloading.</span></div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;<span class="comment">// *</span></div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;<span class="comment">// * @details </span></div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;<span class="comment">// * This is the overloading of the comparison operator for use with PDU.  The result should be TRUE</span></div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;<span class="comment">// * if the left PDU has the same contents as the right PDU.</span></div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;<span class="comment">// * </span></div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;<span class="comment">// * @param left The PDU object to the &quot;left&quot;, to be compared with the &quot;right&quot;.</span></div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;<span class="comment">// * @param right The PDU object to the &quot;right&quot;, to be compared with the &quot;left&quot;.</span></div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;<span class="comment">// */</span></div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;<span class="comment">//bool operator==(const ProtocolDataUnit &amp;left, const ProtocolDataUnit &amp;right)  {</span></div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;<span class="comment">//  return (left.id == right.id &amp;&amp; left.priority == right.priority &amp;&amp; left.associatedEntity == right.associatedEntity &amp;&amp;</span></div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;<span class="comment">//      left.previous == right.previous &amp;&amp; left.next == right.next &amp;&amp; left.source == right.source &amp;&amp; left.destination == right.destination &amp;&amp;</span></div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;<span class="comment">//      left.absoluteGenerationTime == right.absoluteGenerationTime);</span></div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;<span class="comment">//}</span></div>
<div class="ttc" id="class_token_html_a1647ede32e4d927f836a0f58342d77b2"><div class="ttname"><a href="class_token.html#a1647ede32e4d927f836a0f58342d77b2">Token::previous</a></div><div class="ttdeci">std::shared_ptr&lt; Entity &gt; previous</div><div class="ttdoc">Previous entity that had this token (for token routing). </div><div class="ttdef"><b>Definition:</b> <a href="_token_8h_source.html#l00056">Token.h:56</a></div></div>
<div class="ttc" id="class_protocol_data_unit_html_a01adc1a7830a1a40af4daff835226ef3"><div class="ttname"><a href="class_protocol_data_unit.html#a01adc1a7830a1a40af4daff835226ef3">ProtocolDataUnit::decrementTtl</a></div><div class="ttdeci">void decrementTtl()</div><div class="ttdoc">Decrement TTL value. </div><div class="ttdef"><b>Definition:</b> <a href="_protocol_data_unit_8cpp_source.html#l00187">ProtocolDataUnit.cpp:187</a></div></div>
<div class="ttc" id="class_token_html_afc3016125b848c7e88fc5dc8510762ef"><div class="ttname"><a href="class_token.html#afc3016125b848c7e88fc5dc8510762ef">Token::next</a></div><div class="ttdeci">std::shared_ptr&lt; Entity &gt; next</div><div class="ttdoc">Next entity that will have to process this token (to which entity the token has to be &amp;quot;sent&amp;quot;...</div><div class="ttdef"><b>Definition:</b> <a href="_token_8h_source.html#l00057">Token.h:57</a></div></div>
<div class="ttc" id="class_protocol_data_unit_html_aff0a0c4b5851115f75ddee903bef0419"><div class="ttname"><a href="class_protocol_data_unit.html#aff0a0c4b5851115f75ddee903bef0419">ProtocolDataUnit::getTtl</a></div><div class="ttdeci">unsigned short int getTtl() const </div><div class="ttdoc">Gets current TTL value. </div><div class="ttdef"><b>Definition:</b> <a href="_protocol_data_unit_8cpp_source.html#l00197">ProtocolDataUnit.cpp:197</a></div></div>
<div class="ttc" id="class_token_html_ae1697de3383688ddbe8196cb392bf2ac"><div class="ttname"><a href="class_token.html#ae1697de3383688ddbe8196cb392bf2ac">Token::absoluteGenerationTime</a></div><div class="ttdeci">double absoluteGenerationTime</div><div class="ttdoc">Absolute generation timestamp for this token (i.e., the clock time this token was generated)...</div><div class="ttdef"><b>Definition:</b> <a href="_token_8h_source.html#l00047">Token.h:47</a></div></div>
<div class="ttc" id="class_token_html"><div class="ttname"><a href="class_token.html">Token</a></div><div class="ttdoc">Token class. </div><div class="ttdef"><b>Definition:</b> <a href="_token_8h_source.html#l00044">Token.h:44</a></div></div>
<div class="ttc" id="class_protocol_data_unit_html_a2103a889317ce5ea0fdce010c1c3bddd"><div class="ttname"><a href="class_protocol_data_unit.html#a2103a889317ce5ea0fdce010c1c3bddd">ProtocolDataUnit::ProtocolDataUnit</a></div><div class="ttdeci">ProtocolDataUnit(unsigned int id, int priority, std::shared_ptr&lt; Entity &gt; associatedEntity, std::shared_ptr&lt; Entity &gt; source, std::shared_ptr&lt; Entity &gt; destination, unsigned int pduSize)</div><div class="ttdoc">Constructor with parameters, but previous and next. </div><div class="ttdef"><b>Definition:</b> <a href="_protocol_data_unit_8cpp_source.html#l00035">ProtocolDataUnit.cpp:35</a></div></div>
<div class="ttc" id="class_token_html_af5c30f0a60ca47f772e51d06bf8a54c3"><div class="ttname"><a href="class_token.html#af5c30f0a60ca47f772e51d06bf8a54c3">Token::recordThisRoute</a></div><div class="ttdeci">bool recordThisRoute</div><div class="ttdoc">True: route followed by token/PDU must be recorded. False: do not record route followed by token/PDU...</div><div class="ttdef"><b>Definition:</b> <a href="_token_8h_source.html#l00048">Token.h:48</a></div></div>
<div class="ttc" id="class_protocol_data_unit_html_a77fa6a4183a5810c81788f32da6590d1"><div class="ttname"><a href="class_protocol_data_unit.html#a77fa6a4183a5810c81788f32da6590d1">ProtocolDataUnit::ttl</a></div><div class="ttdeci">unsigned short int ttl</div><div class="ttdoc">Time to Live for this PDU. Default will be 128. </div><div class="ttdef"><b>Definition:</b> <a href="_protocol_data_unit_8h_source.html#l00035">ProtocolDataUnit.h:35</a></div></div>
<div class="ttc" id="class_protocol_data_unit_html_abdaa8ab1e636b146205e4cd2aecd81f5"><div class="ttname"><a href="class_protocol_data_unit.html#abdaa8ab1e636b146205e4cd2aecd81f5">ProtocolDataUnit::getPduSize</a></div><div class="ttdeci">unsigned int getPduSize() const </div><div class="ttdoc">Gets PDU size or length in bytes. </div><div class="ttdef"><b>Definition:</b> <a href="_protocol_data_unit_8cpp_source.html#l00229">ProtocolDataUnit.cpp:229</a></div></div>
<div class="ttc" id="class_protocol_data_unit_html_a52885cda1629baaace8edf4a93428c96"><div class="ttname"><a href="class_protocol_data_unit.html#a52885cda1629baaace8edf4a93428c96">ProtocolDataUnit::pduSize</a></div><div class="ttdeci">unsigned int pduSize</div><div class="ttdoc">Size or length of this PDU, typically in bytes. Notice that unsigned short int is not being used so a...</div><div class="ttdef"><b>Definition:</b> <a href="_protocol_data_unit_8h_source.html#l00036">ProtocolDataUnit.h:36</a></div></div>
<div class="ttc" id="class_token_html_a1251a6a9395ed89aac82e88f4c110335"><div class="ttname"><a href="class_token.html#a1251a6a9395ed89aac82e88f4c110335">Token::setExplicitRoute</a></div><div class="ttdeci">virtual void setExplicitRoute(std::vector&lt; std::shared_ptr&lt; Entity &gt;&gt; explicitRoute)</div><div class="ttdoc">Set the explicit route for this token and erases previously recorded route. </div><div class="ttdef"><b>Definition:</b> <a href="_token_8cpp_source.html#l00155">Token.cpp:155</a></div></div>
<div class="ttc" id="class_simulator_globals_html"><div class="ttname"><a href="class_simulator_globals.html">SimulatorGlobals</a></div><div class="ttdoc">Simulator-scope variables and parameters. </div><div class="ttdef"><b>Definition:</b> <a href="_simulator_globals_8h_source.html#l00159">SimulatorGlobals.h:159</a></div></div>
<div class="ttc" id="_protocol_data_unit_8h_html"><div class="ttname"><a href="_protocol_data_unit_8h.html">ProtocolDataUnit.h</a></div></div>
<div class="ttc" id="class_protocol_data_unit_html_a42a8e571a64f65379e3dfc719960ce53"><div class="ttname"><a href="class_protocol_data_unit.html#a42a8e571a64f65379e3dfc719960ce53">ProtocolDataUnit::setTtl</a></div><div class="ttdeci">void setTtl(unsigned short int ttl)</div><div class="ttdoc">Sets TTL (Time To Live) parameter. </div><div class="ttdef"><b>Definition:</b> <a href="_protocol_data_unit_8cpp_source.html#l00211">ProtocolDataUnit.cpp:211</a></div></div>
<div class="ttc" id="class_protocol_data_unit_html_acef2f04f3183ecfe20126c6faed978ff"><div class="ttname"><a href="class_protocol_data_unit.html#acef2f04f3183ecfe20126c6faed978ff">ProtocolDataUnit::setPduSize</a></div><div class="ttdeci">void setPduSize(unsigned int pduSize)</div><div class="ttdoc">Sets PDU size in bytes. </div><div class="ttdef"><b>Definition:</b> <a href="_protocol_data_unit_8cpp_source.html#l00220">ProtocolDataUnit.cpp:220</a></div></div>
<div class="ttc" id="_protocol_data_unit_8h_html_aa9b73542f958f4edfe5ebea8efe0ff8b"><div class="ttname"><a href="_protocol_data_unit_8h.html#aa9b73542f958f4edfe5ebea8efe0ff8b">DEFAULT_TTL</a></div><div class="ttdeci">#define DEFAULT_TTL</div><div class="ttdef"><b>Definition:</b> <a href="_protocol_data_unit_8h_source.html#l00024">ProtocolDataUnit.h:24</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 15 2014 10:33:13 for QCNSim by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
